﻿Ext.regModel('Restaurant', {
    idProperty: 'RESTAURANT_ID',
    fields: [
        { name: 'RESTAURANT_ID', type: 'int' },
        { name: 'RESTAURANT_CATEGORY_ID', type: 'int' },
        { name: 'RESTAURANT_CATEGORY_NAME', type: 'string' },
        { name: 'IMAGE_LOCATION', type: 'string' },
        { name: 'MAPIT', type: 'string' },
        { name: 'YELPIT', type: 'string' },
        { name: 'LAT2', type: 'decimal' },
        { name: 'LONG2', type: 'decimal' },
        { name: 'STREET_ADDRESS1', type: 'string' },
        { name: 'STREET_ADDRESS2', type: 'string' },
        { name: 'CITY', type: 'string' },
        { name: 'STATE', type: 'string' },
        { name: 'ZIP', type: 'int' },
    ]
});

//restaurantStore = new Ext.data.Store({
//    model: 'Restaurant',
//    proxy: {
//        type: 'scripttag',
//        url: 'http://lunchpad.me/service/Service1.svc/getRestaurants',
//        extraParams: {
//            
//        },
//        reader: {
//            type: 'json',
//            root: 'restaurants'
//        },
//        callbackParam: 'callback'
//    },
//    autoload: true
//});

//restaurantStore.load({
//        callback: function () {
//            console.log("test");
//            console.log(restaurantStore);
//        }
//    });

restaurantStore = new Ext.data.Store({
    model: 'Restaurant',
    sorters: 'RESTAURANT_ID',
    data: [
        { "RESTAURANT_ID": 4321, "RESTAURANT_CATEGORY_ID": 4321, "RESTAURANT_CATEGORY_NAME": "Boom Noodle", "IMAGE_LOCATION": "http://media.expedia.com/hotels/1000000/30000/22000/21924/21924_14_t.jpg", "MAPIT": 0, "YELPIT": 0, "LAT2": 47.634106, "LONG2": -122.358942,
            "STREET_ADDRESS1": "4216 Drews Way", "STREET_ADDRESS2": "Apartment #4", "CITY": "Orland", "STATE": "CA", "ZIP": 95963
        },
        { "RESTAURANT_ID": 4322, "RESTAURANT_CATEGORY_ID": 4322, "RESTAURANT_CATEGORY_NAME": "Paddey Coyne", "IMAGE_LOCATION": "http://media.expedia.com/hotels/2000000/1360000/1353500/1353440/1353440_11_t.jpg", "MAPIT": 0, "YELPIT": 0, "LAT2": 47.663364, "LONG2": -122.352505,
            "STREET_ADDRESS1": "3805 Saint Germain Dr", "STREET_ADDRESS2": "Apartment #4", "CITY": "Arlington", "STATE": "TX", "ZIP": 76016
        },
        { "RESTAURANT_ID": 4323, "RESTAURANT_CATEGORY_ID": 4323, "RESTAURANT_CATEGORY_NAME": "Cheesecake Factory", "IMAGE_LOCATION": "http://media.expedia.com/hotels/2000000/1010000/1001500/1001421/1001421_45_t.jpg", "MAPIT": 0, "YELPIT": 0, "LAT2": 47.674982, "LONG2": -122.359886,
            "STREET_ADDRESS1": "4650 Cole Avenue", "STREET_ADDRESS2": "", "CITY": "Dallas", "STATE": "TX", "ZIP": 78705
        }
    ]
});